package com.aaa.project.controller;


import com.aaa.entity.BBusinessInfo;
import com.aaa.project.service.IBBusinessInfoService;
import com.aaa.project.service.IGSortService;
import com.aaa.util.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 商品类别 前端控制器
 * </p>
 *
 * @author zhangxuhui
 * @since 2023-02-19
 */
@RestController
@RequestMapping("/g-sort")
public class GSortController {
    @Resource
    private IGSortService sortService;
    @Resource
    private IBBusinessInfoService businessInfoService;

    @PostMapping("getAllsort")
    public Result getAllsort(String telephone){
        QueryWrapper queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("telephone", telephone);
        BBusinessInfo bBusinessInfo = businessInfoService.getOne(queryWrapper);
        String sortId =  bBusinessInfo.getSortid();
        return  new Result(sortService.getAllSort(sortId));
    }


}

